import { SearchResultResponse, SuggestionResponse } from '@/types/data'
import request from '@/utils/request'
type Params = {
  q: string
}
/**
 * 根据输入的关键词获取联想词列表
 * @param params 
 */
export function getSuggestApi(params: Params): Promise<SuggestionResponse> {
  return request.get('/suggestion', {
    params
  })
}
type SearchParams = {
  page?: number
  per_page?: number
  q: string | null
}
export function getSearchResultApi(params: SearchParams): Promise<SearchResultResponse> {
  return request.get('/search', {
    params
  })
}